<?php
  session_cache_limiter('private,must-revalide');
   /**
   * 处理上传页面
   */  
  include_once("./config.php");
  $tpl = new PhplibTpl($conf["admin_tpl_path"]);  
  
  include_once("list_cate.php");
  $time1=date('Y-m-d H:i:s');
  $tpl -> set_file(array("main" => "bf.htm"));
  $tpl -> set_block("main", "NEWS_LIST", "news_list");

  $count=0;
  $query = "SELECT * FROM $TBL_HOUSE order by id asc";//備份房屋信息
  $result = mysql_query( $query ) or die(mysql_error());
  while($rows = mysql_fetch_array( $result))
  { 
	 ++$count;
	 $array2[$count]=
		 array(
		 $rows['num'],
		 $rows['cate_name'],
		 $rows['user_id'],
		 $rows['source'],
		 $rows['type'],
		 $rows['area'],
		 $rows['hou_name'],

		 $rows['linkman'],
		 $rows['address'],
		 $rows['price'],
		 $rows['sale'],
		 $rows['min_sale'],
		 $rows['deposit'],
		 $rows['layout'],
		 $rows['floor'],
		 $rows['wiring'],

		 $rows['furniture'],
		 $rows['fire'],
		 $rows['elevator'],
		 $rows['unit'],
		 $rows['position'],
		 $rows['age'],
		 $rows['title'],
		 $rows['baohang'],
		 $rows['baoquan'],
		 $rows['tese'],
		 $rows['adminshow'],
		 $rows['add_time'],

		 );
  }
  
  $array3 = serialize($array2);   //把数组转换成字符串
  $_SESSION['house']=$array3; 


  $count2=0;
  $query2 = "SELECT * FROM $TBL_RES order by id asc";// 預約看房
  $result2 = mysql_query( $query2 ) or die(mysql_error());
  while($rows2 = mysql_fetch_array( $result2))
  { 
	 ++$count2;
	 $array22[$count2]=
		 array(
		 $rows2['hou_num'],
		 $rows2['mem_id'],
		 $rows2['name'],
		 $rows2['text'],
		 $rows2['time'],	 
		 $rows2['reback'],		
		 $rows2['retime'],	 

		 );
  }
  
  $array32 = serialize($array22);   //把数组转换成字符串
  $_SESSION['look']=$array32;
  

  $count3=0;
  $query3 = "SELECT * FROM $TBL_CONSULT order by id asc";// 問題咨詢
  $result3 = mysql_query( $query3 ) or die(mysql_error());
  while($rows3 = mysql_fetch_array( $result3))
  { 
	 ++$count3;
	 $array23[$count3]=
		 array(
		 $rows3['hou_num'],
		 $rows3['mem_id'],
		 $rows3['name'],
		 $rows3['consult'],
		 $rows3['time'],	 
		 $rows3['reback'],		
		 $rows3['retime'],	 

		 );
  }
  
  $array33 = serialize($array23);   //把数组转换成字符串
  $_SESSION['consult']=$array33; 


  $count4=0;
  $query4 = "SELECT * FROM $TBL_MEM order by id asc";// 會員
  $result4 = mysql_query( $query4 ) or die(mysql_error());
  while($rows4 = mysql_fetch_array( $result4))
  { 
	 ++$count4;
	 $array24[$count4]=
		 array(
		 $rows4['user_id'],
		 $rows4['name'],
		 $rows4['sex'],
		 $rows4['birth'],
		 $rows4['profession'],
		 $rows4['mobile'],	 
		 $rows4['email'],		
		 $rows4['idk'],	
		 $rows4['tel'],	
		 $rows4['addr'],	 
		 $rows4['type'],
		 $rows4['reg_time'],

		 );
  }

  $array34 = serialize($array24);   //把数组转换成字符串
  $_SESSION['member']=$array34;



  $count5=0;
  $query5 = "SELECT * FROM $TBL_REINFO order by id asc";// 租出
  $result5 = mysql_query( $query5 ) or die(mysql_error());
  while($rows5 = mysql_fetch_array( $result5))
  { 
	 ++$count5;
	 $array25[$count5]=
		 array(
		 $rows5['hou_num'],
		 $rows5['mem_id'],
		 $rows5['tel'],
		 $rows5['addr'],
		 $rows5['date'],
		 $rows5['type'],	 
		 $rows5['mess'],		
		 $rows5['datetime'],
		 );
  }
  
  $array35 = serialize($array25);   //把数组转换成字符串
  $_SESSION['rent']=$array35;


  $count6=0;
  $query6 = "SELECT * FROM $TBL_REPAY order by id asc";// 繳費
  $result6 = mysql_query( $query6 ) or die(mysql_error());
  while($rows6 = mysql_fetch_array( $result6))
  { 
	 ++$count6;
	 $array26[$count6]=
		 array(
		 $rows6['mem_id'],
		 $rows6['inbank'],
		 $rows6['innum'],
		 $rows6['outbank'],
		 $rows6['outnum'],
		 $rows6['name'],	 
		 $rows6['senttime'],		
		 $rows6['addr'],
		 $rows6['price'],
		 $rows6['linkman'],		  
		 $rows6['tel'],
		 $rows6['datetime'],

		 );
  }
  
  $array36 = serialize($array26);   //把数组转换成字符串
  $_SESSION['pay']=$array36;


  $count7=0;
  $query7 = "SELECT * FROM $TBL_CONTACT where id!=1 order by id asc";// 租出
  $result7 = mysql_query( $query7 ) or die(mysql_error());
  while($rows7 = mysql_fetch_array( $result7))
  { 
	 ++$count7;
	 $array27[$count7]=
		 array(
		 $rows7['name'],
		 $rows7['sex'],
		 $rows7['email'],
		 $rows7['tel'],
		 $rows7['addr'],
		 $rows7['city'],	 		
		 $rows7['type'],
		 $rows7['price'],
		 $rows7['demand'],		  
		 $rows7['datetime'],
		 );
  }
  
  $array37 = serialize($array27);   //把数组转换成字符串
  $_SESSION['contact']=$array37;


  
  $tpl->set_var($conf);
  $tpl -> parse("Output", "main");
  $tpl -> p("Output");
  exit(0);
?>